package com.fluxtah.jordl.examples.twitter;

import com.fluxtah.jordl.lib.Transformer;
import com.fluxtah.jordl.lib.TransformException;
import org.json.JSONObject;
import org.json.JSONException;

public class TwitterUserOutputTransformer extends Transformer<TwitterUser, JSONObject> {
	public void transform(TwitterUser source, JSONObject target) throws TransformException {
		try {
			target.putOpt("contributors_enabled", source.isContributorsEnabled());
			target.putOpt("created_at", source.getCreatedAt());
			target.putOpt("default_profile", source.isDefaultProfile());
			target.putOpt("default_profile_image", source.isDefaultProfileImage());
			target.putOpt("description", source.getDescription());
			target.putOpt("favourites_count", source.getFavouritesCount());
			target.putOpt("followers_count", source.getFollowersCount());
			target.putOpt("friends_count", source.getFriendsCount());
			target.putOpt("geo_enabled", source.isGeoEnabled());
			target.putOpt("id", source.getId());
			target.putOpt("id_str", source.getIdStr());
			target.putOpt("is_translator", source.isIsTranslator());
			target.putOpt("lang", source.getLang());
			target.putOpt("listed_count", source.getListedCount());
			target.putOpt("location", source.getLocation());
			target.putOpt("name", source.getName());
			target.putOpt("profile_background_color", source.getProfileBackgroundColor());
			target.putOpt("profile_background_image_url", source.getProfileBackgroundImageUrl());
			target.putOpt("profile_background_image_url_https", source.getProfileBackgroundImageUrlHttps());
			target.putOpt("profile_background_tile", source.isProfileBackgroundTile());
			target.putOpt("profile_image_url", source.getProfileImageUrl());
			target.putOpt("profile_image_url_https", source.getProfileImageUrlHttps());
			target.putOpt("profile_link_color", source.getProfileLinkColor());
			target.putOpt("profile_sidebar_border_color", source.getProfileSidebarBorderColor());
			target.putOpt("profile_sidebar_fill_color", source.getProfileSidebarFillColor());
			target.putOpt("protected", source.isProtected());
			target.putOpt("screen_name", source.getScreenName());
			target.putOpt("show_all_inline_media", source.isShowAllInlineMedia());
			target.putOpt("statuses_count", source.getStatusesCount());
			target.putOpt("url", source.getUrl());
			target.putOpt("verified", source.isVerified());
		} catch (JSONException x) {
			throw new TransformException(x);
		}
	}
}
